import java.util.Scanner;

public class PhoneNumberChecker {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String phoneNumber = null;
		boolean isValid = false;

		while (!isValid) {
			try {
				System.out.print("请输入手机号码：");
				phoneNumber = scanner.nextLine().trim();

				if (phoneNumber.length() != 11) {
					throw new IllegalArgumentException("手机号码必须是11位");
				}

				// 检查是否全为数字
				Long.parseLong(phoneNumber);

				// 检查手机号前三位是否符合规则（13-19开头）
				if (!phoneNumber.matches("1[3-9]\\d{9}")) {
					throw new IllegalArgumentException("手机号码格式不正确（需以13-19开头）");
				}

				isValid = true;
				System.out.println("输入正确！您的手机号码是：" + phoneNumber);

			} catch (IllegalArgumentException e) {
				System.out.println("输入错误：" + e.getMessage() + "，请重新输入！");
			}
		}

		scanner.close();
	}
}
